package com.aitaoxue.palx.adapter;

import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.aitaoxue.palx.R;
import com.aitaoxue.palx.base.ListBaseAdapter;
import com.aitaoxue.palx.bean.Test;

public class NewsAdapter extends ListBaseAdapter {

	@Override
	protected View getRealView(int position, View convertView, ViewGroup parent) {
		ViewHolder vh = null;
		if (convertView == null || convertView.getTag() == null) {
			convertView = getLayoutInflater(parent.getContext()).inflate(
					R.layout.list_cell_home, null);
			vh=new ViewHolder(convertView);
			convertView.setTag(vh);
		} else {
			vh=(ViewHolder) convertView.getTag();
		}
		
		Test test=(Test) _data.get(position);
		vh.title.setText(test.getName());
		
		return convertView;
	}

	static class ViewHolder {
		public TextView title;

		public ViewHolder(View view){
			this.title=(TextView) view.findViewById(R.id.list_cell_home_tv);
		}
	}
}
